<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template basic_any</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../any/reference.html#header.boost.any.basic_any_hpp" title="Header &lt;boost/any/basic_any.hpp&gt;">
<link rel="prev" href="../bad_any_cast.html" title="Class bad_any_cast">
<link rel="next" href="swap.html" title="Function swap">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
<td align="center"><a href="../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../bad_any_cast.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../any/reference.html#header.boost.any.basic_any_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="swap.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.anys.basic_any"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template basic_any</span></h2>
<p>boost::anys::basic_any — A class with customizable Small Object Optimization whose instances can hold instances of any
          type that satisfies <a class="link" href="../../any/reference.html#any.ValueType" title="ValueType requirements">ValueType</a>
          requirements. Use <code class="computeroutput"><a class="link" href="../any.html" title="Class any">boost::any</a></code> instead if not sure.</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../any/reference.html#header.boost.any.basic_any_hpp" title="Header &lt;boost/any/basic_any.hpp&gt;">boost/any/basic_any.hpp</a>&gt;

</span><span class="keyword">template</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> OptimizeForSize<span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> OptimizeForAlignment<span class="special">&gt;</span> 
<span class="keyword">class</span> <a class="link" href="basic_any.html" title="Class template basic_any">basic_any</a> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// <a class="link" href="basic_any.html#boost.anys.basic_anyconstruct-copy-destruct">construct/copy/destruct</a></span>
  <a class="link" href="basic_any.html#id-1_3_5_5_4_1_1_1_4-bb"><span class="identifier">basic_any</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="basic_any.html#id-1_3_5_5_4_1_1_1_5-bb"><span class="identifier">basic_any</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="basic_any.html" title="Class template basic_any">basic_any</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="basic_any.html#id-1_3_5_5_4_1_1_1_6-bb"><span class="identifier">basic_any</span></a><span class="special">(</span><a class="link" href="basic_any.html" title="Class template basic_any">basic_any</a> <span class="special">&amp;&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> ValueType<span class="special">&gt;</span> <a class="link" href="basic_any.html#id-1_3_5_5_4_1_1_1_7-bb"><span class="identifier">basic_any</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">ValueType</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> ValueType<span class="special">&gt;</span> <a class="link" href="basic_any.html#id-1_3_5_5_4_1_1_1_8-bb"><span class="identifier">basic_any</span></a><span class="special">(</span><span class="identifier">ValueType</span> <span class="special">&amp;&amp;</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="basic_any.html" title="Class template basic_any">basic_any</a> <span class="special">&amp;</span> <a class="link" href="basic_any.html#id-1_3_5_5_4_1_1_1_10-bb"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="basic_any.html" title="Class template basic_any">basic_any</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="basic_any.html" title="Class template basic_any">basic_any</a> <span class="special">&amp;</span> <a class="link" href="basic_any.html#id-1_3_5_5_4_1_1_1_11-bb"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><a class="link" href="basic_any.html" title="Class template basic_any">basic_any</a> <span class="special">&amp;&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> ValueType<span class="special">&gt;</span> <a class="link" href="basic_any.html" title="Class template basic_any">basic_any</a> <span class="special">&amp;</span> <a class="link" href="basic_any.html#id-1_3_5_5_4_1_1_1_12-bb"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">ValueType</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> ValueType<span class="special">&gt;</span> <a class="link" href="basic_any.html" title="Class template basic_any">basic_any</a> <span class="special">&amp;</span> <a class="link" href="basic_any.html#id-1_3_5_5_4_1_1_1_13-bb"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><span class="identifier">ValueType</span> <span class="special">&amp;&amp;</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="basic_any.html#id-1_3_5_5_4_1_1_1_9-bb"><span class="special">~</span><span class="identifier">basic_any</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="basic_any.html#id-1_3_5_5_4_1_1_1_14-bb">modifiers</a></span>
  <a class="link" href="basic_any.html" title="Class template basic_any">basic_any</a> <span class="special">&amp;</span> <a class="link" href="basic_any.html#id-1_3_5_5_4_1_1_1_14_1-bb"><span class="identifier">swap</span></a><span class="special">(</span><a class="link" href="basic_any.html" title="Class template basic_any">basic_any</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="basic_any.html#id-1_3_5_5_4_1_1_1_15-bb">queries</a></span>
  <span class="keyword">bool</span> <a class="link" href="basic_any.html#id-1_3_5_5_4_1_1_1_15_1-bb"><span class="identifier">empty</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">const</span> std::type_info <span class="special">&amp;</span> <a class="link" href="basic_any.html#id-1_3_5_5_4_1_1_1_15_2-bb"><span class="identifier">type</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="id-1.3.5.5.5.3.4"></a><h2>Description</h2>
<p><code class="computeroutput"><a class="link" href="basic_any.html" title="Class template basic_any">boost::anys::basic_any</a></code> is the drop-in replacement for
              <code class="computeroutput"><a class="link" href="../any.html" title="Class any">boost::any</a></code> that provides controll over Small Object
              Optimization via <code class="computeroutput">OptimizeForSize</code> and <code class="computeroutput">OptimizeForAlignment</code> template
              parameters.</p>
<p>There are certain applications that require <code class="computeroutput"><a class="link" href="../any.html" title="Class any">boost::any</a></code>
              functionality, do know the typical/maximal size of the stored object and wish to avoid dynamic memory
              allocation overhead. For the convenience such applications may create a typedef for <code class="computeroutput">basic_any</code>
              with the <code class="computeroutput">OptimizeForSize</code> and <code class="computeroutput">OptimizeForAlignment</code> template parameters set to
              typical/maximal size and alignment of types respectively. Memory allocation would be avoided
              for storing nothrow move constructible types with size and alignment less than or
              equal to the <code class="computeroutput">OptimizeForSize</code> and <code class="computeroutput">OptimizeForAlignment</code> values.</p>
<p>Otherwise just use <code class="computeroutput"><a class="link" href="../any.html" title="Class any">boost::any</a></code>.</p>
<div class="refsect2">
<a name="id-1.3.5.5.5.3.4.5"></a><h3>
<a name="boost.anys.basic_anyconstruct-copy-destruct"></a><code class="computeroutput">basic_any</code> 
        public
       construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><a name="id-1_3_5_5_4_1_1_1_4-bb"></a><span class="identifier">basic_any</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Postconditions:</span></p></td>
<td><code class="computeroutput">this-&gt;<a class="link" href="basic_any.html#id-1_3_5_5_4_1_1_1_15_1-bb">empty</a>()</code></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><a name="id-1_3_5_5_4_1_1_1_5-bb"></a><span class="identifier">basic_any</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="basic_any.html" title="Class template basic_any">basic_any</a> <span class="special">&amp;</span> other<span class="special">)</span><span class="special">;</span></pre>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Effects:</span></p></td>
<td> Copy constructor that copies content of
            <code class="computeroutput">other</code> into new instance, so that any content
            is equivalent in both type and value to the content of
            <code class="computeroutput">other</code>, or empty if <code class="computeroutput">other</code> is
            empty. </td>
</tr>
<tr>
<td><p><span class="term">Throws:</span></p></td>
<td>May fail with a
            <code class="computeroutput">std::bad_alloc</code>
            exception or any exceptions arising from the copy
            constructor of the contained type.</td>
</tr>
</tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><a name="id-1_3_5_5_4_1_1_1_6-bb"></a><span class="identifier">basic_any</span><span class="special">(</span><a class="link" href="basic_any.html" title="Class template basic_any">basic_any</a> <span class="special">&amp;&amp;</span> other<span class="special">)</span><span class="special">;</span></pre>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Effects:</span></p></td>
<td> Move constructor that moves content of
            <code class="computeroutput">other</code> into new instance and leaves <code class="computeroutput">other</code>
            empty. </td>
</tr>
<tr>
<td><p><span class="term">Postconditions:</span></p></td>
<td><code class="computeroutput">other-&gt;<a class="link" href="basic_any.html#id-1_3_5_5_4_1_1_1_15_1-bb">empty</a>()</code></td>
</tr>
<tr>
<td><p><span class="term">Throws:</span></p></td>
<td>Nothing.</td>
</tr>
</tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> ValueType<span class="special">&gt;</span> <a name="id-1_3_5_5_4_1_1_1_7-bb"></a><span class="identifier">basic_any</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">ValueType</span> <span class="special">&amp;</span> value<span class="special">)</span><span class="special">;</span></pre>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Effects:</span></p></td>
<td>
<p class="simpara">Makes a copy of <code class="computeroutput">value</code>, so
            that the initial content of the new instance is equivalent
            in both type and value to
            <code class="computeroutput">value</code>.</p>
<p class="simpara">Does not dynamically allocate if <code class="computeroutput">ValueType</code> is nothrow
            move constructible and <code class="computeroutput">sizeof(value) &lt;= OptimizeForSize
            &amp;&amp; alignof(value) &lt;=OptimizeForAlignment</code>.</p>
</td>
</tr>
<tr>
<td><p><span class="term">Throws:</span></p></td>
<td>
<code class="computeroutput">std::bad_alloc</code>
            or any exceptions arising from the copy constructor of the
            contained type.</td>
</tr>
</tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> ValueType<span class="special">&gt;</span> <a name="id-1_3_5_5_4_1_1_1_8-bb"></a><span class="identifier">basic_any</span><span class="special">(</span><span class="identifier">ValueType</span> <span class="special">&amp;&amp;</span> value<span class="special">)</span><span class="special">;</span></pre>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Effects:</span></p></td>
<td>
<p class="simpara">Forwards <code class="computeroutput">value</code>, so
            that the initial content of the new instance is equivalent
            in both type and value to
            <code class="computeroutput">value</code> before the forward.</p>
<p class="simpara">Does not dynamically allocate if <code class="computeroutput">ValueType</code> is nothrow
            move constructible and <code class="computeroutput">sizeof(value) &lt;= OptimizeForSize
            &amp;&amp; alignof(value) &lt;=OptimizeForAlignment</code>.</p>
</td>
</tr>
<tr>
<td><p><span class="term">Throws:</span></p></td>
<td>
<code class="computeroutput">std::bad_alloc</code>
            or any exceptions arising from the move or copy constructor of the
            contained type.</td>
</tr>
</tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><a class="link" href="basic_any.html" title="Class template basic_any">basic_any</a> <span class="special">&amp;</span> <a name="id-1_3_5_5_4_1_1_1_10-bb"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="basic_any.html" title="Class template basic_any">basic_any</a> <span class="special">&amp;</span> rhs<span class="special">)</span><span class="special">;</span></pre>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Effects:</span></p></td>
<td>Copies content of <code class="computeroutput">rhs</code> into
            current instance, discarding previous content, so that the
            new content is equivalent in both type and value to the
            content of <code class="computeroutput">rhs</code>, or empty if
            <code class="computeroutput">rhs.<a class="link" href="basic_any.html#id-1_3_5_5_4_1_1_1_15_1-bb">empty</a>()</code>.</td>
</tr>
<tr>
<td><p><span class="term">Throws:</span></p></td>
<td>
<code class="computeroutput">std::bad_alloc</code>
            or any exceptions arising from the copy constructor of the
            contained type. Assignment satisfies the strong guarantee
            of exception safety.</td>
</tr>
</tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><a class="link" href="basic_any.html" title="Class template basic_any">basic_any</a> <span class="special">&amp;</span> <a name="id-1_3_5_5_4_1_1_1_11-bb"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><a class="link" href="basic_any.html" title="Class template basic_any">basic_any</a> <span class="special">&amp;&amp;</span> rhs<span class="special">)</span><span class="special">;</span></pre>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Effects:</span></p></td>
<td>Moves content of <code class="computeroutput">rhs</code> into
            current instance, discarding previous content, so that the
            new content is equivalent in both type and value to the
            content of <code class="computeroutput">rhs</code> before move, or empty if
            <code class="computeroutput">rhs.<a class="link" href="basic_any.html#id-1_3_5_5_4_1_1_1_15_1-bb">empty</a>()</code>.</td>
</tr>
<tr>
<td><p><span class="term">Postconditions:</span></p></td>
<td><code class="computeroutput">rhs-&gt;<a class="link" href="basic_any.html#id-1_3_5_5_4_1_1_1_15_1-bb">empty</a>()</code></td>
</tr>
<tr>
<td><p><span class="term">Throws:</span></p></td>
<td>Nothing.</td>
</tr>
</tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> ValueType<span class="special">&gt;</span> <a class="link" href="basic_any.html" title="Class template basic_any">basic_any</a> <span class="special">&amp;</span> <a name="id-1_3_5_5_4_1_1_1_12-bb"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">ValueType</span> <span class="special">&amp;</span> rhs<span class="special">)</span><span class="special">;</span></pre>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Effects:</span></p></td>
<td>
<p class="simpara">Makes a copy of <code class="computeroutput">rhs</code>,
            discarding previous content, so that the new content of is
            equivalent in both type and value to
            <code class="computeroutput">rhs</code>.</p>
<p class="simpara">Does not dynamically allocate if <code class="computeroutput">ValueType</code> is nothrow
            move constructible and <code class="computeroutput">sizeof(value) &lt;= OptimizeForSize
            &amp;&amp; alignof(value) &lt;=OptimizeForAlignment</code>.</p>
</td>
</tr>
<tr>
<td><p><span class="term">Throws:</span></p></td>
<td>
<code class="computeroutput">std::bad_alloc</code>
            or any exceptions arising from the copy constructor of the
            contained type. Assignment satisfies the strong guarantee
            of exception safety.</td>
</tr>
</tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> ValueType<span class="special">&gt;</span> <a class="link" href="basic_any.html" title="Class template basic_any">basic_any</a> <span class="special">&amp;</span> <a name="id-1_3_5_5_4_1_1_1_13-bb"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><span class="identifier">ValueType</span> <span class="special">&amp;&amp;</span> rhs<span class="special">)</span><span class="special">;</span></pre>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Effects:</span></p></td>
<td>
<p class="simpara">Forwards <code class="computeroutput">rhs</code>,
            discarding previous content, so that the new content of is
            equivalent in both type and value to
            <code class="computeroutput">rhs</code> before forward.</p>
<p class="simpara">Does not dynamically allocate if <code class="computeroutput">ValueType</code> is nothrow
            move constructible and <code class="computeroutput">sizeof(value) &lt;= OptimizeForSize
            &amp;&amp; alignof(value) &lt;=OptimizeForAlignment</code>.</p>
</td>
</tr>
<tr>
<td><p><span class="term">Throws:</span></p></td>
<td>
<code class="computeroutput">std::bad_alloc</code>
            or any exceptions arising from the move or copy constructor of the
            contained type. Assignment satisfies the strong guarantee
            of exception safety.</td>
</tr>
</tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><a name="id-1_3_5_5_4_1_1_1_9-bb"></a><span class="special">~</span><span class="identifier">basic_any</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Effects:</span></p></td>
<td>Releases any and all resources used in
            management of instance.</td>
</tr>
<tr>
<td><p><span class="term">Throws:</span></p></td>
<td>Nothing.</td>
</tr>
</tbody>
</table></div>
</li>
</ol></div>
</div>
<div class="refsect2">
<a name="id-1.3.5.5.5.3.4.6"></a><h3>
<a name="id-1_3_5_5_4_1_1_1_14-bb"></a><code class="computeroutput">basic_any</code> modifiers</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<pre class="literallayout"><a class="link" href="basic_any.html" title="Class template basic_any">basic_any</a> <span class="special">&amp;</span> <a name="id-1_3_5_5_4_1_1_1_14_1-bb"></a><span class="identifier">swap</span><span class="special">(</span><a class="link" href="basic_any.html" title="Class template basic_any">basic_any</a> <span class="special">&amp;</span> rhs<span class="special">)</span><span class="special">;</span></pre>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Effects:</span></p></td>
<td>Exchange of the contents of
              <code class="computeroutput">*this</code> and
              <code class="computeroutput">rhs</code>.</td>
</tr>
<tr>
<td><p><span class="term">Returns:</span></p></td>
<td><code class="computeroutput">*this</code></td>
</tr>
<tr>
<td><p><span class="term">Throws:</span></p></td>
<td>Nothing.</td>
</tr>
</tbody>
</table></div>
</li></ol></div>
</div>
<div class="refsect2">
<a name="id-1.3.5.5.5.3.4.7"></a><h3>
<a name="id-1_3_5_5_4_1_1_1_15-bb"></a><code class="computeroutput">basic_any</code> queries</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">bool</span> <a name="id-1_3_5_5_4_1_1_1_15_1-bb"></a><span class="identifier">empty</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Returns:</span></p></td>
<td>
<code class="computeroutput">true</code> if instance is
              empty, otherwise <code class="computeroutput">false</code>.</td>
</tr>
<tr>
<td><p><span class="term">Throws:</span></p></td>
<td>Nothing.</td>
</tr>
</tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">const</span> std::type_info <span class="special">&amp;</span> <a name="id-1_3_5_5_4_1_1_1_15_2-bb"></a><span class="identifier">type</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Returns:</span></p></td>
<td>the <code class="computeroutput">typeid</code> of the
              contained value if instance is non-empty, otherwise
              <code class="computeroutput">typeid(void)</code>.</td>
</tr>
<tr>
<td><p><span class="term">Notes:</span></p></td>
<td>Useful for querying against types known
              either at compile time or only at
              runtime.</td>
</tr>
</tbody>
</table></div>
</li>
</ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2001 Kevlin Henney<br>Copyright © 2013-2021 Antony Polukhin<p>Distributed under the Boost Software License, Version 1.0.
      (See accompanying file <code class="filename">LICENSE_1_0.txt</code> or copy at 
      <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../bad_any_cast.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../any/reference.html#header.boost.any.basic_any_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="swap.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
